﻿using LuShanTea.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuShanTea.IService
{
    public interface ICartRecordService : IServiceSupport
    {
        /// <summary>
        /// 给购物车添加商品
        /// </summary>
        /// <param name="cartId">购物车Id</param>
        /// <param name="goodId">商品Id</param>
        /// <param name="packId">包装Id</param>
        /// <param name="count">上平数量</param>
        /// <returns></returns>
        long AddNew(long cartId,long goodId,long packId,int count);
        /// <summary>
        /// 删除购物车记录的商品
        /// </summary>
        /// <param name="cartRecordId"></param>
        void MarkDelete(long cartRecordId);
        /// <summary>
        /// 更新购物车记录
        /// </summary>
        void Update(long cartRecordId,int count,long packId);
        /// <summary>
        /// 更新购物车商品数量
        /// </summary>
        /// <param name="cartRecordId"></param>
        /// <param name="count"></param>
        void UpdateCount(long cartRecordId, int count);
        /// <summary>
        /// 根据Id获取
        /// </summary>
        /// <param name="cartRecordId"></param>
        /// <returns></returns>
        CartRecordDTO GetById(long cartRecordId);

        /// <summary>
        /// 购买商品
        /// </summary>
        /// <param name="cartRecordId"></param>
        /// <param name="isBuy"></param>
        void BuyGood(long cartRecordId);

        /// <summary>
        /// 获取已购买的商品
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        CartRecordDTO[] GetBuyCartByCartId(long cartId);

        /// <summary>
        /// 获取未购买的商品
        /// </summary>
        /// <param name="cartId"></param>
        /// <returns></returns>
        CartRecordDTO[] GetNoBuyCartByCartId(long cartId);

        /// <summary>
        /// 分页获取所有购物车内商品
        /// </summary>
        /// <returns></returns>
        CartRecordDTO[] GetPage(int pageIndex,int dataCount);

        /// <summary>
        /// 获取数据总条数
        /// </summary>
        /// <returns></returns>
        long GetTotalCount();
    }
}
